package com.cawis.controller;

import com.cawis.common.R;
import com.cawis.service.FlashService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "雷电查询服务接口")
@RestController
@RequiredArgsConstructor
public class FlashController {

    private final FlashService flashService;

    @ApiOperation(value = "雷电信息查询", notes = "雷电信息查询")
    @GetMapping("flashList")
    public R flashList(String startTime, String endTime, @RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer pageSize) {
        return R.ok(flashService.selectPage(startTime, endTime, current, pageSize));
    }

    @ApiOperation(value = "线路杆塔关联查询", notes = "线路杆塔关联查询")
    @GetMapping("dataList")
    public R dataList(String lineName, Integer lineId) {
        return R.ok(flashService.dataList(lineName, lineId));
    }


}
